<?php

/**
 * Copyright 2010 - 2013, Cake Development Corporation (http://cakedc.com)
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright Copyright 2010 - 2013, Cake Development Corporation (http://cakedc.com)
 * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
App::uses('Security', 'Utility');

/**
 * Businesses Plugin Business Model
 *
 * @package Business
 * @subpackage Business.Model
 */
class Business extends AppModel {

	/**
	 * Name
	 *
	 * @var string
	 */
	public $name = 'Business';

	/**
	 * Displayfield
	 *
	 * @var string $displayField
	 */
	public $displayField = 'name';

	/**
	 * Time the email verification token is valid in seconds
	 *
	 * @var integer
	 */
	public $emailTokenExpirationTime = 86400;

	/**
	 * Validation domain for translations 
	 *
	 * @var string
	 */
	public $validationDomain = 'businesses';

	/**
	 * Validation parameters
	 *
	 * @var array
	 */
	public $validate = array(
		'name' => array(
			'required' => array(
				'rule' => array('notEmpty'),
				'required' => true,
				'allowEmpty' => false,
				'message' => 'Please enter a name.'
			),
			'unique_name' => array(
				'rule' => array('isUnique', 'name'),
				'message' => 'This name is already in use.'
			)
		),
		'offer_number' => array(
			'required' => array(
				'rule' => array('notEmpty'),
				'required' => true,
				'allowEmpty' => false,
				'message' => 'Please enter a offer number.'
			)
		),
		'value' => array(
			'required' => array(
				'rule' => array('notEmpty'),
				'required' => true,
				'allowEmpty' => false,
				'message' => 'Please enter a value.'
			),
		)
	);

}
